<template>
	<view :class="themeName">
		<view class="headers white md">
			<view class="flex row-between p-b-30 m-b-20 h-top">
				<view class="flex">
					<image style="width: 119rpx; height: 119rpx; border-radius: 50%" :src="msg.image" mode=""></image>
					<view class="m-l-20 sm">
						<view>门店：{{msg.name}}</view>
						<view>单价：￥{{msg.price}}</view>
						<view>地址：{{msg.address}}</view>
					</view>
				</view>
			</view>
		</view>
		<view class="commission flex row-around">
			<view class="c-box">
				<view style="color: #5ba042">已提现佣金</view>
				<view>{{msg.yitixian}}元</view>
			</view>
			<view class="xian"></view>
			<view class="c-box">
				<view style="color: #ef8d31">未结算佣金</view>
				<view>{{msg.weijiesuan}}元</view>
			</view>
		</view>

		<view class="serve-nav flex2 flex-wrap">
			<view class="nav-item flex-col col-center" v-for="(item, index) in lists" :key="index" @click="goto(item.title)">
				<u-image width="60rpx" height="60rpx" :src="item.icon" />
				<view class="xs m-t-12 black md">{{ item.title }}</view>
				<view>
					<view v-if="item.title=='分佣佣金'"><text style="color: #0980cc">{{msg.yongjin1}}</text>元</view>
					<view v-if="item.title=='分佣订单'"><text style="color: #0980cc">{{msg.yongjin2}}</text>元</view>
					<view v-else-if="item.title=='我的机器人'"><text style="color: #0980cc">{{msg.jiqiren}}</text>个</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import { shopinfo } from '@/api/others';
export default {
	data() {
		return {
			msg:{},
			lists:[
				{title:'分佣佣金',icon:'/others/static/a8.png'},
				{title:'分佣订单',icon:'/others/static/a9.png'},
				{title:'我的机器人',icon:'/others/static/a12.png'},
				{title:'收益统计',icon:'/others/static/a13.png'},
				{title:'提现列表',icon:'/others/static/a20.png'},
			]
		};
	},
	async onShow() {
		await this.getInfo();
	},
	methods: {
		getInfo(){
			shopinfo().then(res => {
				this.msg = res;
			});
		},
		goto(title){
			console.log(title)
			if(title=='分佣佣金'){
				return;
			}else if(title=='分佣订单'){
				uni.navigateTo({
					url:'/others/pages/dealer/orderList?shenfen=2'
				})
			}else if(title=='收益统计'){
				uni.navigateTo({
					url:'/others/pages/manager/income'
				})
			}else if(title=='我的机器人'){
				uni.navigateTo({
					url:'/others/pages/manager/myjqr'
				})
			}else if(title=='提现列表'){
				uni.navigateTo({
					url:'/others/pages/manager/examine'
				})
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.headers {
	background: url('https://s11.ax1x.com/2023/12/21/piTPZ4A.png') no-repeat;
	background-size: 100% 100%;
	width: 100%;
	height: 200rpx;
	padding: 35rpx 50rpx 0 25rpx;
}
.commission {
	margin: 20rpx;
	background-color: #fff;
	padding: 35rpx 0rpx;
	text-align: center;
	box-sizing: border-box;

	.c-box {
		width: 45%;
		line-height: 160%;
	}
	.xian {
		border-left: 1px solid #999;
		height: 70rpx;
	}
}

.serve-nav {
	padding:30rpx 0;
	background-color: #fff;
	margin: 20rpx;
	.nav-item {
		width: 33.33%;
		margin: 30rpx 0;
	}
}
</style>
